//TODO clean up includes
#include <cv.h>
#include <highgui.h>
#include "abstractProbabilityTransformer.hpp"
#include "abstractFilter.hpp"
#include "resourceTracker.h"
#include "faceDetector.h"
#include "AbstractHandTracker.hpp"
#include "HIVideoCapture.hpp"
#include "handLocaliser.hpp"
#include "AbstractHandTrackerTest.hpp"

#include <iostream>
#include "gtest.h"

#include "HandTrackerLKHSVCx.hpp"


//FIXNOW: normalise error according to tracking rect size? (include both normalised and raw error)

using namespace cv;



class HandTrackerLKHSVCxTest : public ::AbstractHandTrackerTest {
protected:
	void setHandTracker(int trackerCode);
};


void HandTrackerLKHSVCxTest::setHandTracker(int trackerCode) {
	
	switch ( trackerCode ) {
	
		case 0:
			ht = HandTrackerLKHSVCx::init( trackingRect, frame, 1 );
			break;
		case 1:
			ht = HandTrackerLKHSVCx::init( trackingRect, frame, 10 );
			break;
		case 2:
			ht = HandTrackerLKHSVCx::init( trackingRect, frame, 50 );
			break;
		default:
			ASSERT_TRUE(false);
			break;
	}
}



TEST_F(HandTrackerLKHSVCxTest, Corners1locVid1c ) {
	testTracker( 0, "locVid1c" );
}

TEST_F(HandTrackerLKHSVCxTest, Corners10locVid1c ) {
	testTracker( 1, "locVid1c" );
}

TEST_F(HandTrackerLKHSVCxTest, Corners50locVid1c ) {
	testTracker( 2, "locVid1c" );
}

TEST_F(HandTrackerLKHSVCxTest, Corners1TrackerTest1 ) {
	testTracker( 0, "TrackerTest1" );
}

TEST_F(HandTrackerLKHSVCxTest, Corners10TrackerTest1 ) {
	testTracker( 1, "TrackerTest1" );
}

TEST_F(HandTrackerLKHSVCxTest, Corners50TrackerTest1 ) {
	testTracker( 2, "TrackerTest1" );
}
